$NG.AllReady(function (page, { useAction, useBeforeClick, useValuesChange, useClick, useUpdateRow, subscribe, useUpdateRows }) {
    const mstform = $NG.getCmpApi("p_form_fblx_m")
    const dgrid1 = $NG.getCmpApi("p_form_fblx_d1")
    const getHeadValue = (str)=>mstform.getItem(str).getValue()
    const config = {
        list_data_bak : []
    
    }
GctsFilter()
    if(page.isList){
        setInterval(()=>{
            let bigBox = $NG.getCmpApi("grid")?.getRef()?.bodyRef.current
             const start = new Date().getTime()
             let dom = bigBox.childNodes[0].childNodes[0]
            // while(new Date().getTime() - start < 10 * 1000 && !dom){
            //     dom = document.childNodes[0].childNodes[0]
            // }
            // if(!dom){
            //     $NG.alert("发生异常！")
            // }
            if(!dom){
                return
            }
            dom.childNodes.forEach(el=>{
                let colorLock = false
                // console.log(`el`,el);
                el.childNodes.forEach(it=>{
                    if(it.getAttribute("data-key") == 'u_ykqk'){
                        const minDom = it.childNodes[0]?.textContent
                        if((Number(minDom) || 0) < 0){
                            colorLock = true
                        }
                    }
                })
                if(colorLock){
                    el.childNodes.forEach(item=>{
                        item.style.background = '#ff000038'
                    })
                }
            })
        },1000)
    }

    useValuesChange(()=>{
        GctsFilter()
    },"u_fbxmchsbh")

    function GctsFilter(){
         mstform.getItem("u_gctssxbh").setProps({
            onBeforeOpen: async () => {
                var u_fbxmchsbh = getHeadValue("u_fbxmchsbh")
                if (!u_fbxmchsbh) {
                    $NG.alert("请选择分包项目策划书编号！");
                    return false;
                } else {
                    return true;
                }
            },
            clientSqlFilter: {
                phid: getHeadValue("u_fbxmchsbh"),
            }
        });
    }
})